<?php
class Application_Model_Factory_Domain implements Application_Model_Factory_DomainInterface
{
	/**
	 * 
	 * @throws LogicException
	 * @param string $type
	 * @return Application_Model_Domain_DomainAbstract
	 */
	public function get ($type, $arguments = null)
	{
		$className = 'Application_Model_Domain_' . ucfirst($type);
		if (! class_exists($className)) {
			throw new LogicException(
				__METHOD__ . ', Cannot find classname ' . $className
			);
		}
		if (is_null($arguments)) {
			$domainInstance = new $className();
		} else {
			$domainInstance = new $className($arguments);
		}
		return $domainInstance;
	}
}